package ru.ifmo.kis.domaingen;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;

// Nov 24, 2010 4:04:22 PM
@javax.persistence.Table(name = "roles", catalog = "ItmoKis")
@Entity
public class RolesEntity {
	private int id;

	@javax.persistence.Column(name = "id", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Id
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	private String name;

	@javax.persistence.Column(name = "name", nullable = true, insertable = true, updatable = true, length = 64, precision = 0)
	@Basic
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		RolesEntity that = (RolesEntity) o;

		if (id != that.id) return false;
		if (name != null ? !name.equals(that.name) : that.name != null) return false;

		return true;
	}

	@Override
	public int hashCode() {
		int result = id;
		result = 31 * result + (name != null ? name.hashCode() : 0);
		return result;
	}
}
